package com.wbs.shop.nuby.jsbridge;


import com.alibaba.fastjson.JSONObject;
import com.wbs.shop.nuby.commom.Key;
import com.wbs.shop.nuby.jsbridge.core.BaseInjected;
import com.wbs.shop.nuby.utils.DOMStorageUtils;
import com.wbs.shop.nuby.view.listener.IWebView;

/**
 * Created by zhoucl on 2017/4/25 0025.
 */

public class LocalInjected extends BaseInjected {
    public LocalInjected(IWebView webView) {
        super(webView);
    }

    public void set(JSONObject jsonObject) {
        DOMStorageUtils.putLocal(jsonObject.getString(Key.KEY), jsonObject.getString(Key.VALUE));
    }

    public String get(JSONObject jsonObject) {
        return DOMStorageUtils.getLocal(jsonObject.getString(Key.KEY));
    }
}
